import request from '@/utils/request';

// 其他出库单列表
export function otherOutboundList(data) {
    return request({
        url: '/system/otherInboundOrder/list',
        method: 'get',
        params: data
    })
}

// 其他出库单新建
export function otherOutboundAdd(data) {
    return request({
        url: '/system/otherOutOfStockOrder/otherInboundOrderAdd',
        method: 'post',
        data: data
    })
}

// 其他出库单产品新建
export function otherOutboundDataAdd(data) {
    return request({
        url: '/system/otherOutOfStockOrder/otherInboundOrderDetailAdd',
        method: 'post',
        data: data
    })
}

// 其他出库单编辑
export function otherOutboundEdit(data) {
    return request({
        url: '/system/otherOutOfStockOrder/otherInboundOrderUpdate',
        method: 'post',
        data: data
    })
}

// 其他出库单产品编辑
export function otherOutboundDataEdit(data) {
    return request({
        url: '/system/otherOutOfStockOrder/otherInboundOrderDetailUpdate',
        method: 'post',
        data: data
    })
}

// 其他出库单详情
export function otherOutboundDetail(id) {
    return request({
        url: '/system/otherOutOfStockOrder/getById/' + id,
        method: 'get'
    })
}

// 其他入库单删除/扫码删除/删除多仓位
export function otherOutboundDelete(data) {
    return request({
        url: '/system/otherOutOfStockOrder/delete',
        method: 'post',
        data: data
    })
}

// 多仓位列表
export function morePosition(id) {
    return request({
        url: '/system/otherOutOfStockOrder/getProductMultiPositionList/' + id,
        method: 'get',
    })
}

// 多仓位添加
export function morePositionAdd(data) {
    return request({
        url: '/system/otherOutOfStockOrder/productMultiPositionAdd',
        method: 'post',
        data: data
    })
}

// 多仓位编辑
export function morePositionEdit(data) {
    return request({
        url: '/system/otherOutOfStockOrder/productMultiPositionUpdate',
        method: 'post',
        data: data
    })
}

// 扫码出库
export function scanCode(id, code) {
    return request({
        url: '/system/otherOutOfStockOrder/scanCodeForOutbound?otherInboundOrderId=' + id + '&code=' + code,
        method: 'post'
    })
}

// 确定出库
export function confirmOutbound(id) {
    return request({
        url: '/system/otherOutOfStockOrder/confirmOutbound?id=' + id,
        method: 'post'
    })
}

// 查询库存
export function getStock(data) {
    return request({
        url: '/system/otherOutOfStockOrder/getStock',
        method: 'post',
        data: data
    })
}